<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新增文章分类</title>
    <style>
        /* 全局样式 */
        body {
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background-color: #f9f9f9;
            margin: 0;
            padding: 0;
            color: #333;
            line-height: 1.6;
        }

        .container {
            max-width: 500px;
            margin: 60px auto;
            padding: 30px;
            background-color: #fff;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
            border-radius: 12px;
        }

        /* 标题样式 */
        h1 {
            text-align: center;
            color: #3a7d44;
            margin-bottom: 30px;
            font-weight: 600;
        }

        /* 表单样式 */
        .form-container {
            display: flex;
            flex-direction: column;
        }

        /* 标签样式 */
        label {
            margin-top: 15px;
            font-weight: 500;
            color: #555;
        }

        /* 输入框样式 */
        input[type="text"] {
            width: 100%;
            padding: 12px 15px;
            margin-top: 5px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 15px;
            transition: border 0.3s;
        }

        input[type="text"]:focus {
            border-color: #4caf50;
            outline: none;
            box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
        }

        /* 按钮样式 */
        .button-group {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 25px;
        }

        .btn {
            padding: 10px 20px;
            border-radius: 6px;
            font-size: 15px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            border: none;
            flex: 1;
        }

        .btn-primary {
            background-color: #4CAF50;
            color: white;
        }

        .btn-primary:hover {
            background-color: #388e3c;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .btn-secondary {
            background-color: #f5f5f5;
            color: #333;
        }

        .btn-secondary:hover {
            background-color: #e0e0e0;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                margin: 30px 15px;
                padding: 20px;
            }
        }
    </style>
</head>
<body>

<div class="container">
    <h1>新增文章分类</h1>
    <form th:action="@{/category/add}" method="post">
        <div class="form-container">
            <label for="name">分类名称：</label>
            <input type="text" id="name" name="name" required />
            <div class="button-group">
                <button type="submit" class="btn btn-primary">保存</button>
                <a th:href="@{/category/}" class="btn btn-secondary">返回</a>
            </div>
        </div>
    </form>
</div>

</body>
</html>